#CMakeLists for src directory.

set(AMZ_SERVER_SRCS_BASE
  base/byte_buffer_dynamic.cc
  base/common.cc
  base/logging.cc
  base/log_lite.cc)

set(AMZ_SERVER_SRCS_NETWORK
  network/tcp_socket.cc
  network/message_packet.cc
  network/tcp_packet_socket_communicator.cc
  network/tcp_buffer_socket_communicator.cc
  network/udp_socket.cc
  network/udp_socket_communicator.cc
  network/udp_packet_socket_communicator.cc
  network/udp_stream_socket_communicator.cc
  network/udp_credible_pattern_sender.cc
  network/udp_credible_pattern_receiver.cc
  network/udp_credible_stream_socket_communicator.cc)

set(AMZ_SERVER_SRCS_THREAD
  thread/ring_queue_single_model_bound.cc
  thread/ring_queue_single_model_boundless.cc
  thread/ring_queue_multiple_model_bound.cc
  thread/ring_queue_multiple_model_boundless.cc
  thread/thread.cc)

set(AMZ_SERVER_SRCS_TEST
  test/test_thread.cc)

#Shared library
add_library(amz SHARED
  ${AMZ_SERVER_SRCS_BASE} 
  ${AMZ_SERVER_SRCS_NETWORK} 
  ${AMZ_SERVER_SRCS_THREAD})

#Static library
add_library(amz_static STATIC
  ${AMZ_SERVER_SRCS_BASE} 
  ${AMZ_SERVER_SRCS_NETWORK} 
  ${AMZ_SERVER_SRCS_THREAD})

#Ensure build both share and static library using same name.
set_target_properties(amz_static PROPERTIES OUTPUT_NAME "amz")
set_target_properties(amz PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(amz_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
